skip attempt to install updates at launch when update checks are disabled
authorJyrki Gadinger <nilsding@nilsding.org>
Mon, 10 Feb 2025 15:03:56 +0000 (16:03 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 11 Feb 2025 08:11:45 +0000 (09:11 +0100)
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
src/gui/updater/ocupdater.cpp

index b5f6ad49ddf84c2c4836fac7674d64ecba30f82d..5ea60813011ae7de702f0ae6ffcaa7f2042af3bf 100644 (file)
@@ -496,6 +496,13 @@ bool NSISUpdater::handleStartup()
 {
     ConfigFile cfg;
     QSettings settings(cfg.configFile(), QSettings::IniFormat);
+
+    // no need to try to install a previously fetched update when the user doesn't want automated updates
+    if (cfg.skipUpdateCheck() || !cfg.autoUpdateCheck()) {
+        qCInfo(lcUpdater) << "Skipping installation of update due to config settings";
+        return false;
+    }
+
     QString updateFileName = settings.value(updateAvailableC).toString();
     // has the previous run downloaded an update?
     if (!updateFileName.isEmpty() && QFile(updateFileName).exists()) {